<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>$.load()方法</title>
</head>
<body>

    
    <div class="content">
        <button id="btn">点我获取</button><span id="info"></span>
        <div id="box"></div>
    </div>
    
    
    <script src="./jquery-3.6.0.js"></script>
    
    
    <script>
        
        /*
            dom.load:直接将数据渲染到dom容器中，适合渲染后端返回的html标签内容或者纯文本内容
            $(selector).load(URL,data,callback);
            url: ttps://route.showapi.com/109-34?appKey=${key}     key="8c53f287791b4Bd6b418A14c24F8402f"
        */
    
        $(function () {
            $('#btn').click(function () {
                // 本地文件
                let key = "8c53f287791b4Bd6b418A14c24F8402f"
            //   $("#box").load('./data/test.txt')
                $("#box").load(`https://route.showapi.com/109-34?appKey=${key}`)
            })
        })
        


    </script>
</body>
</html>